
gcd.o:     file format elf64-littleaarch64


Disassembly of section .text:

0000000000000000 <gcd>:
#include <stdio.h>

// 递归法求最大公约数，当最大公约数是1的时候，两个数互质
// if(gcd(x,y)==1)那么x,y互质
int gcd(int a, int b)
{
   0:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
   4:	910003fd 	mov	x29, sp
   8:	b9001fa0 	str	w0, [x29, #28] ; a
   c:	b9001ba1 	str	w1, [x29, #24] ; b
	if (b == 0)
  10:	b9401ba0 	ldr	w0, [x29, #24] ; w0 = b
  14:	7100001f 	cmp	w0, #0x0       ; b == 0 ?
  18:	54000061 	b.ne	24 <gcd+0x24>  // b.any
		return a;
  1c:	b9401fa0 	ldr	w0, [x29, #28] ; w0 = a
  20:	1400000a 	b	48 <gcd+0x48>  ; return a
	else 
		return gcd(b, a % b);
  24:	b9401fa0 	ldr	w0, [x29, #28] ; a
  28:	b9401ba1 	ldr	w1, [x29, #24] ; b
  2c:	1ac10c02 	sdiv	w2, w0, w1 ; w2 = a / b
  30:	b9401ba1 	ldr	w1, [x29, #24] ; w1 = b
  34:	1b017c41 	mul	w1, w2, w1     ; b = (a/b) * b
  38:	4b010000 	sub	w0, w0, w1     ; w0 = a - b
  3c:	2a0003e1 	mov	w1, w0         ; w1 = a - b
  40:	b9401ba0 	ldr	w0, [x29, #24] ; w0 = b
  44:	94000000 	bl	0 <gcd>
}
  48:	a8c27bfd 	ldp	x29, x30, [sp], #32
  4c:	d65f03c0 	ret

0000000000000050 <main>:

void main()
{
  50:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  54:	910003fd 	mov	x29, sp
	int a, b, prime;

	a = 10;
  58:	52800140 	mov	w0, #0xa                   	// #10
  5c:	b9001fa0 	str	w0, [x29, #28]
	b = 5;
  60:	528000a0 	mov	w0, #0x5                   	// #5
  64:	b9001ba0 	str	w0, [x29, #24]
	prime = 0;
  68:	b90017bf 	str	wzr, [x29, #20]

	prime = gcd(a, b);
  6c:	b9401ba1 	ldr	w1, [x29, #24]
  70:	b9401fa0 	ldr	w0, [x29, #28]
  74:	94000000 	bl	0 <gcd>
  78:	b90017a0 	str	w0, [x29, #20]

	if (prime == 1) {
  7c:	b94017a0 	ldr	w0, [x29, #20]
  80:	7100041f 	cmp	w0, #0x1
  84:	540000a1 	b.ne	98 <main+0x48>  // b.any
		printf(" relatively prime (互质)\n");
  88:	90000000 	adrp	x0, 0 <gcd>
  8c:	91000000 	add	x0, x0, #0x0
  90:	94000000 	bl	0 <puts>
	}
	else {
		printf("%d\n", prime);
	}
}
  94:	14000005 	b	a8 <main+0x58>
		printf("%d\n", prime);
  98:	90000000 	adrp	x0, 0 <gcd>
  9c:	91000000 	add	x0, x0, #0x0
  a0:	b94017a1 	ldr	w1, [x29, #20]
  a4:	94000000 	bl	0 <printf>
}
  a8:	d503201f 	nop
  ac:	a8c27bfd 	ldp	x29, x30, [sp], #32
  b0:	d65f03c0 	ret
